/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.triumphsys.icici.cmeeting.portlet.service.persistence;

import com.liferay.portal.NoSuchModelException;
import com.liferay.portal.kernel.annotation.BeanReference;
import com.liferay.portal.kernel.cache.CacheRegistryUtil;
import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
import com.liferay.portal.kernel.dao.orm.FinderPath;
import com.liferay.portal.kernel.dao.orm.Query;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.Session;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.InstanceFactory;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.model.ModelListener;
import com.liferay.portal.service.persistence.BatchSessionUtil;
import com.liferay.portal.service.persistence.ResourcePersistence;
import com.liferay.portal.service.persistence.UserPersistence;
import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;

import com.triumphsys.icici.cmeeting.portlet.NoSuchCMPoliciesProposalException;
import com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposal;
import com.triumphsys.icici.cmeeting.portlet.model.impl.CMPoliciesProposalImpl;
import com.triumphsys.icici.cmeeting.portlet.model.impl.CMPoliciesProposalModelImpl;

import java.io.Serializable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * The persistence implementation for the c m policies proposal service.
 *
 * <p>
 * Never modify or reference this class directly. Always use {@link CMPoliciesProposalUtil} to access the c m policies proposal persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
 * </p>
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author Triumphsys
 * @see CMPoliciesProposalPersistence
 * @see CMPoliciesProposalUtil
 * @generated
 */
public class CMPoliciesProposalPersistenceImpl extends BasePersistenceImpl<CMPoliciesProposal>
	implements CMPoliciesProposalPersistence {
	public static final String FINDER_CLASS_NAME_ENTITY = CMPoliciesProposalImpl.class.getName();
	public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
		".List";
	public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(CMPoliciesProposalModelImpl.ENTITY_CACHE_ENABLED,
			CMPoliciesProposalModelImpl.FINDER_CACHE_ENABLED,
			FINDER_CLASS_NAME_LIST, "findAll", new String[0]);
	public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(CMPoliciesProposalModelImpl.ENTITY_CACHE_ENABLED,
			CMPoliciesProposalModelImpl.FINDER_CACHE_ENABLED,
			FINDER_CLASS_NAME_LIST, "countAll", new String[0]);

	/**
	 * Caches the c m policies proposal in the entity cache if it is enabled.
	 *
	 * @param cmPoliciesProposal the c m policies proposal to cache
	 */
	public void cacheResult(CMPoliciesProposal cmPoliciesProposal) {
		EntityCacheUtil.putResult(CMPoliciesProposalModelImpl.ENTITY_CACHE_ENABLED,
			CMPoliciesProposalImpl.class, cmPoliciesProposal.getPrimaryKey(),
			cmPoliciesProposal);
	}

	/**
	 * Caches the c m policies proposals in the entity cache if it is enabled.
	 *
	 * @param cmPoliciesProposals the c m policies proposals to cache
	 */
	public void cacheResult(List<CMPoliciesProposal> cmPoliciesProposals) {
		for (CMPoliciesProposal cmPoliciesProposal : cmPoliciesProposals) {
			if (EntityCacheUtil.getResult(
						CMPoliciesProposalModelImpl.ENTITY_CACHE_ENABLED,
						CMPoliciesProposalImpl.class,
						cmPoliciesProposal.getPrimaryKey(), this) == null) {
				cacheResult(cmPoliciesProposal);
			}
		}
	}

	/**
	 * Clears the cache for all c m policies proposals.
	 *
	 * <p>
	 * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
	 * </p>
	 */
	public void clearCache() {
		CacheRegistryUtil.clear(CMPoliciesProposalImpl.class.getName());
		EntityCacheUtil.clearCache(CMPoliciesProposalImpl.class.getName());
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
	}

	/**
	 * Clears the cache for the c m policies proposal.
	 *
	 * <p>
	 * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
	 * </p>
	 */
	public void clearCache(CMPoliciesProposal cmPoliciesProposal) {
		EntityCacheUtil.removeResult(CMPoliciesProposalModelImpl.ENTITY_CACHE_ENABLED,
			CMPoliciesProposalImpl.class, cmPoliciesProposal.getPrimaryKey());
	}

	/**
	 * Creates a new c m policies proposal with the primary key. Does not add the c m policies proposal to the database.
	 *
	 * @param policiesProposalId the primary key for the new c m policies proposal
	 * @return the new c m policies proposal
	 */
	public CMPoliciesProposal create(long policiesProposalId) {
		CMPoliciesProposal cmPoliciesProposal = new CMPoliciesProposalImpl();

		cmPoliciesProposal.setNew(true);
		cmPoliciesProposal.setPrimaryKey(policiesProposalId);

		return cmPoliciesProposal;
	}

	/**
	 * Removes the c m policies proposal with the primary key from the database. Also notifies the appropriate model listeners.
	 *
	 * @param primaryKey the primary key of the c m policies proposal to remove
	 * @return the c m policies proposal that was removed
	 * @throws com.liferay.portal.NoSuchModelException if a c m policies proposal with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public CMPoliciesProposal remove(Serializable primaryKey)
		throws NoSuchModelException, SystemException {
		return remove(((Long)primaryKey).longValue());
	}

	/**
	 * Removes the c m policies proposal with the primary key from the database. Also notifies the appropriate model listeners.
	 *
	 * @param policiesProposalId the primary key of the c m policies proposal to remove
	 * @return the c m policies proposal that was removed
	 * @throws com.triumphsys.icici.cmeeting.portlet.NoSuchCMPoliciesProposalException if a c m policies proposal with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public CMPoliciesProposal remove(long policiesProposalId)
		throws NoSuchCMPoliciesProposalException, SystemException {
		Session session = null;

		try {
			session = openSession();

			CMPoliciesProposal cmPoliciesProposal = (CMPoliciesProposal)session.get(CMPoliciesProposalImpl.class,
					new Long(policiesProposalId));

			if (cmPoliciesProposal == null) {
				if (_log.isWarnEnabled()) {
					_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
						policiesProposalId);
				}

				throw new NoSuchCMPoliciesProposalException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
					policiesProposalId);
			}

			return remove(cmPoliciesProposal);
		}
		catch (NoSuchCMPoliciesProposalException nsee) {
			throw nsee;
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	protected CMPoliciesProposal removeImpl(
		CMPoliciesProposal cmPoliciesProposal) throws SystemException {
		cmPoliciesProposal = toUnwrappedModel(cmPoliciesProposal);

		Session session = null;

		try {
			session = openSession();

			BatchSessionUtil.delete(session, cmPoliciesProposal);
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}

		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

		EntityCacheUtil.removeResult(CMPoliciesProposalModelImpl.ENTITY_CACHE_ENABLED,
			CMPoliciesProposalImpl.class, cmPoliciesProposal.getPrimaryKey());

		return cmPoliciesProposal;
	}

	public CMPoliciesProposal updateImpl(
		com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposal cmPoliciesProposal,
		boolean merge) throws SystemException {
		cmPoliciesProposal = toUnwrappedModel(cmPoliciesProposal);

		Session session = null;

		try {
			session = openSession();

			BatchSessionUtil.update(session, cmPoliciesProposal, merge);

			cmPoliciesProposal.setNew(false);
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}

		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

		EntityCacheUtil.putResult(CMPoliciesProposalModelImpl.ENTITY_CACHE_ENABLED,
			CMPoliciesProposalImpl.class, cmPoliciesProposal.getPrimaryKey(),
			cmPoliciesProposal);

		return cmPoliciesProposal;
	}

	protected CMPoliciesProposal toUnwrappedModel(
		CMPoliciesProposal cmPoliciesProposal) {
		if (cmPoliciesProposal instanceof CMPoliciesProposalImpl) {
			return cmPoliciesProposal;
		}

		CMPoliciesProposalImpl cmPoliciesProposalImpl = new CMPoliciesProposalImpl();

		cmPoliciesProposalImpl.setNew(cmPoliciesProposal.isNew());
		cmPoliciesProposalImpl.setPrimaryKey(cmPoliciesProposal.getPrimaryKey());

		cmPoliciesProposalImpl.setPoliciesProposalId(cmPoliciesProposal.getPoliciesProposalId());
		cmPoliciesProposalImpl.setCodCcmDt(cmPoliciesProposal.getCodCcmDt());
		cmPoliciesProposalImpl.setBranchId(cmPoliciesProposal.getBranchId());
		cmPoliciesProposalImpl.setApprovalTl(cmPoliciesProposal.getApprovalTl());
		cmPoliciesProposalImpl.setLoanAmt(cmPoliciesProposal.getLoanAmt());
		cmPoliciesProposalImpl.setIpNetM(cmPoliciesProposal.getIpNetM());
		cmPoliciesProposalImpl.setProposalName(cmPoliciesProposal.getProposalName());
		cmPoliciesProposalImpl.setReportingAId1(cmPoliciesProposal.getReportingAId1());
		cmPoliciesProposalImpl.setReportingAId2(cmPoliciesProposal.getReportingAId2());
		cmPoliciesProposalImpl.setModel(cmPoliciesProposal.getModel());
		cmPoliciesProposalImpl.setMethodology(cmPoliciesProposal.getMethodology());
		cmPoliciesProposalImpl.setSmId1(cmPoliciesProposal.getSmId1());
		cmPoliciesProposalImpl.setSmId2(cmPoliciesProposal.getSmId2());
		cmPoliciesProposalImpl.setProgram(cmPoliciesProposal.getProgram());
		cmPoliciesProposalImpl.setProgramExpiry(cmPoliciesProposal.getProgramExpiry());
		cmPoliciesProposalImpl.setProposalId(cmPoliciesProposal.getProposalId());

		return cmPoliciesProposalImpl;
	}

	/**
	 * Finds the c m policies proposal with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
	 *
	 * @param primaryKey the primary key of the c m policies proposal to find
	 * @return the c m policies proposal
	 * @throws com.liferay.portal.NoSuchModelException if a c m policies proposal with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public CMPoliciesProposal findByPrimaryKey(Serializable primaryKey)
		throws NoSuchModelException, SystemException {
		return findByPrimaryKey(((Long)primaryKey).longValue());
	}

	/**
	 * Finds the c m policies proposal with the primary key or throws a {@link com.triumphsys.icici.cmeeting.portlet.NoSuchCMPoliciesProposalException} if it could not be found.
	 *
	 * @param policiesProposalId the primary key of the c m policies proposal to find
	 * @return the c m policies proposal
	 * @throws com.triumphsys.icici.cmeeting.portlet.NoSuchCMPoliciesProposalException if a c m policies proposal with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public CMPoliciesProposal findByPrimaryKey(long policiesProposalId)
		throws NoSuchCMPoliciesProposalException, SystemException {
		CMPoliciesProposal cmPoliciesProposal = fetchByPrimaryKey(policiesProposalId);

		if (cmPoliciesProposal == null) {
			if (_log.isWarnEnabled()) {
				_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
					policiesProposalId);
			}

			throw new NoSuchCMPoliciesProposalException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
				policiesProposalId);
		}

		return cmPoliciesProposal;
	}

	/**
	 * Finds the c m policies proposal with the primary key or returns <code>null</code> if it could not be found.
	 *
	 * @param primaryKey the primary key of the c m policies proposal to find
	 * @return the c m policies proposal, or <code>null</code> if a c m policies proposal with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public CMPoliciesProposal fetchByPrimaryKey(Serializable primaryKey)
		throws SystemException {
		return fetchByPrimaryKey(((Long)primaryKey).longValue());
	}

	/**
	 * Finds the c m policies proposal with the primary key or returns <code>null</code> if it could not be found.
	 *
	 * @param policiesProposalId the primary key of the c m policies proposal to find
	 * @return the c m policies proposal, or <code>null</code> if a c m policies proposal with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public CMPoliciesProposal fetchByPrimaryKey(long policiesProposalId)
		throws SystemException {
		CMPoliciesProposal cmPoliciesProposal = (CMPoliciesProposal)EntityCacheUtil.getResult(CMPoliciesProposalModelImpl.ENTITY_CACHE_ENABLED,
				CMPoliciesProposalImpl.class, policiesProposalId, this);

		if (cmPoliciesProposal == null) {
			Session session = null;

			try {
				session = openSession();

				cmPoliciesProposal = (CMPoliciesProposal)session.get(CMPoliciesProposalImpl.class,
						new Long(policiesProposalId));
			}
			catch (Exception e) {
				throw processException(e);
			}
			finally {
				if (cmPoliciesProposal != null) {
					cacheResult(cmPoliciesProposal);
				}

				closeSession(session);
			}
		}

		return cmPoliciesProposal;
	}

	/**
	 * Finds all the c m policies proposals.
	 *
	 * @return the c m policies proposals
	 * @throws SystemException if a system exception occurred
	 */
	public List<CMPoliciesProposal> findAll() throws SystemException {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}

	/**
	 * Finds a range of all the c m policies proposals.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param start the lower bound of the range of c m policies proposals to return
	 * @param end the upper bound of the range of c m policies proposals to return (not inclusive)
	 * @return the range of c m policies proposals
	 * @throws SystemException if a system exception occurred
	 */
	public List<CMPoliciesProposal> findAll(int start, int end)
		throws SystemException {
		return findAll(start, end, null);
	}

	/**
	 * Finds an ordered range of all the c m policies proposals.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param start the lower bound of the range of c m policies proposals to return
	 * @param end the upper bound of the range of c m policies proposals to return (not inclusive)
	 * @param orderByComparator the comparator to order the results by
	 * @return the ordered range of c m policies proposals
	 * @throws SystemException if a system exception occurred
	 */
	public List<CMPoliciesProposal> findAll(int start, int end,
		OrderByComparator orderByComparator) throws SystemException {
		Object[] finderArgs = new Object[] {
				String.valueOf(start), String.valueOf(end),
				String.valueOf(orderByComparator)
			};

		List<CMPoliciesProposal> list = (List<CMPoliciesProposal>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
				finderArgs, this);

		if (list == null) {
			StringBundler query = null;
			String sql = null;

			if (orderByComparator != null) {
				query = new StringBundler(2 +
						(orderByComparator.getOrderByFields().length * 3));

				query.append(_SQL_SELECT_CMPOLICIESPROPOSAL);

				appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
					orderByComparator);

				sql = query.toString();
			}
			else {
				sql = _SQL_SELECT_CMPOLICIESPROPOSAL.concat(CMPoliciesProposalModelImpl.ORDER_BY_JPQL);
			}

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				if (orderByComparator == null) {
					list = (List<CMPoliciesProposal>)QueryUtil.list(q,
							getDialect(), start, end, false);

					Collections.sort(list);
				}
				else {
					list = (List<CMPoliciesProposal>)QueryUtil.list(q,
							getDialect(), start, end);
				}
			}
			catch (Exception e) {
				throw processException(e);
			}
			finally {
				if (list == null) {
					FinderCacheUtil.removeResult(FINDER_PATH_FIND_ALL,
						finderArgs);
				}
				else {
					cacheResult(list);

					FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs,
						list);
				}

				closeSession(session);
			}
		}

		return list;
	}

	/**
	 * Removes all the c m policies proposals from the database.
	 *
	 * @throws SystemException if a system exception occurred
	 */
	public void removeAll() throws SystemException {
		for (CMPoliciesProposal cmPoliciesProposal : findAll()) {
			remove(cmPoliciesProposal);
		}
	}

	/**
	 * Counts all the c m policies proposals.
	 *
	 * @return the number of c m policies proposals
	 * @throws SystemException if a system exception occurred
	 */
	public int countAll() throws SystemException {
		Object[] finderArgs = new Object[0];

		Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
				finderArgs, this);

		if (count == null) {
			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(_SQL_COUNT_CMPOLICIESPROPOSAL);

				count = (Long)q.uniqueResult();
			}
			catch (Exception e) {
				throw processException(e);
			}
			finally {
				if (count == null) {
					count = Long.valueOf(0);
				}

				FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
					count);

				closeSession(session);
			}
		}

		return count.intValue();
	}

	/**
	 * Initializes the c m policies proposal persistence.
	 */
	public void afterPropertiesSet() {
		String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
					com.liferay.util.service.ServiceProps.get(
						"value.object.listener.com.triumphsys.icici.cmeeting.portlet.model.CMPoliciesProposal")));

		if (listenerClassNames.length > 0) {
			try {
				List<ModelListener<CMPoliciesProposal>> listenersList = new ArrayList<ModelListener<CMPoliciesProposal>>();

				for (String listenerClassName : listenerClassNames) {
					listenersList.add((ModelListener<CMPoliciesProposal>)InstanceFactory.newInstance(
							listenerClassName));
				}

				listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
			}
			catch (Exception e) {
				_log.error(e);
			}
		}
	}

	public void destroy() {
		EntityCacheUtil.removeCache(CMPoliciesProposalImpl.class.getName());
		FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
		FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST);
	}

	@BeanReference(type = CMHolidayPersistence.class)
	protected CMHolidayPersistence cmHolidayPersistence;
	@BeanReference(type = CMParameterPersistence.class)
	protected CMParameterPersistence cmParameterPersistence;
	@BeanReference(type = CMUserPersistence.class)
	protected CMUserPersistence cmUserPersistence;
	@BeanReference(type = CMCreditRatingPersistence.class)
	protected CMCreditRatingPersistence cmCreditRatingPersistence;
	@BeanReference(type = COEPropoalTypePersistence.class)
	protected COEPropoalTypePersistence coePropoalTypePersistence;
	@BeanReference(type = CMIndustryPersistence.class)
	protected CMIndustryPersistence cmIndustryPersistence;
	@BeanReference(type = CMCompanyPersistence.class)
	protected CMCompanyPersistence cmCompanyPersistence;
	@BeanReference(type = CMControlGroupPersistence.class)
	protected CMControlGroupPersistence cmControlGroupPersistence;
	@BeanReference(type = CMRolePersistence.class)
	protected CMRolePersistence cmRolePersistence;
	@BeanReference(type = CMBranchPersistence.class)
	protected CMBranchPersistence cmBranchPersistence;
	@BeanReference(type = CMRegionPersistence.class)
	protected CMRegionPersistence cmRegionPersistence;
	@BeanReference(type = CMForumPersistence.class)
	protected CMForumPersistence cmForumPersistence;
	@BeanReference(type = CMSubForumPersistence.class)
	protected CMSubForumPersistence cmSubForumPersistence;
	@BeanReference(type = CMSanctionProposalPersistence.class)
	protected CMSanctionProposalPersistence cmSanctionProposalPersistence;
	@BeanReference(type = CMReportingProposalPersistence.class)
	protected CMReportingProposalPersistence cmReportingProposalPersistence;
	@BeanReference(type = CMPostProposalPersistence.class)
	protected CMPostProposalPersistence cmPostProposalPersistence;
	@BeanReference(type = CMMeetingPersistence.class)
	protected CMMeetingPersistence cmMeetingPersistence;
	@BeanReference(type = CMProposalTypePersistence.class)
	protected CMProposalTypePersistence cmProposalTypePersistence;
	@BeanReference(type = CMEntityPersistence.class)
	protected CMEntityPersistence cmEntityPersistence;
	@BeanReference(type = CMOthersProposalPersistence.class)
	protected CMOthersProposalPersistence cmOthersProposalPersistence;
	@BeanReference(type = CMValuationProposalPersistence.class)
	protected CMValuationProposalPersistence cmValuationProposalPersistence;
	@BeanReference(type = CMPoliciesProposalPersistence.class)
	protected CMPoliciesProposalPersistence cmPoliciesProposalPersistence;
	@BeanReference(type = CMProposalPersistence.class)
	protected CMProposalPersistence cmProposalPersistence;
	@BeanReference(type = ResourcePersistence.class)
	protected ResourcePersistence resourcePersistence;
	@BeanReference(type = UserPersistence.class)
	protected UserPersistence userPersistence;
	private static final String _SQL_SELECT_CMPOLICIESPROPOSAL = "SELECT cmPoliciesProposal FROM CMPoliciesProposal cmPoliciesProposal";
	private static final String _SQL_COUNT_CMPOLICIESPROPOSAL = "SELECT COUNT(cmPoliciesProposal) FROM CMPoliciesProposal cmPoliciesProposal";
	private static final String _ORDER_BY_ENTITY_ALIAS = "cmPoliciesProposal.";
	private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No CMPoliciesProposal exists with the primary key ";
	private static Log _log = LogFactoryUtil.getLog(CMPoliciesProposalPersistenceImpl.class);
}